<style>
tr.striped {
        background-color: #0ec0cc;
}
</style>
<script type="text/javascript">
	$(function() {
	    $('.search-result-item-wrapper').hover(
	        function(){
				$(this).addClass("owners-operation-background").find(".owners-operation span").show();
	         },
	         function(){
	            $(this).removeClass("owners-operation-background").find(".owners-operation span").hide();
	         }
	     );
	     $("span.left-category-image-thumb").svgallery({'animationSpeed' : 500});
	     
	});
</script>    

<?
	$sess = new Zend_Session_Namespace(CLU_NS);
?>
<div class="box white_bg">
<div class="box">
	<div class="vietnam_content">
	     <div class="lienket_title"><a href="#"><span> <?=t(909)?> </span></a> 
		     <?if(isset($this->viewParams['cityName'])):?>
		     	<?if($sess->viewLang == 'vi')echo $this->viewParams['cityName']; else echo VN_unaccent($this->viewParams['cityName'])?>
		     <?endif?>
		     <?if(isset($this->viewParams['cityName'])):?>&nbsp; &raquo; &nbsp;
		     	<?if($sess->viewLang == 'vi')echo $this->viewParams['districtName']; else echo VN_unaccent($this->viewParams['districtName'])?>
		     <?endif?>
	     	 <?if(isset($this->viewParams['categoryName'])):?>&nbsp; &raquo; &nbsp;<?=p($this->viewParams['categoryName']['name'])?><?endif?></div>           
	   	 <div class="clear"></div>
	   </div>  
	</div>
        
   <div class="ketquatimkiem_list_left">
       &nbsp;&nbsp;&nbsp;<span><?=t(140)?></span>   
   </div>

<? if(isset($this->viewParams['eventList']) && count($this->viewParams['eventList']) > 0) :?>   
	
	<!-- pagination -->
<div>
<?
$pageCount = ceil($this->viewParams['paginator']->getTotalItemCount()/$this->viewParams['paginator']->getItemCountPerPage());
?>
<? if ($pageCount > 1) :?>
	<?= $this->paginationControl($this->viewParams['paginator'], 'Sliding', '/modules/common/views/scripts/commonTheme/commonLang/common/clu-pagination-control.phtml',
							    array('searchUrl' => $this->viewParams['searchUrl'])); ?>
<?endif ?>
</div>

            <?$i = 0; ?>
			<?foreach ($this->viewParams['eventList'] as $event):?>
			<?$i++; ?>
			<script type="text/javascript">
				var oriLang = ' ';
				var lang = '<?= $sess->viewLang?>';
			    googleTranslate(oriLang, lang, 'camnang_heritage_title', 'catagory_result_add');
			</script>
			<?$metaData = unserialize($event['metadata']);?>
            <div class="catagory_result_list">
                  <div class="catagory_result_img">
	                  <?
	       				$thumb = str_replace("/original/","/medium/", $event['thumb']); 
	                    if(!empty($thumb))
	                    	$ret = "<img src='$thumb' align='absmiddle' />";
		       			else
		       				$ret = "<img src='/public/themes/prime/images/common/75x75_no_image.gif' />";
	                  ?>
	                  <?=$ret?> 
                  </div>
                  <div class="camnang_heritage_title"><a href="<?=$this->hvnUrl(array('module' => 'event', 'action' => 'view'))?>?id=<?=$event['id']?>"><?= $this->viewParams['aList'][$event['id']]['article_title']?></a></div>
                  <div class="catagory_result_add"><b><?=t(777)?> &nbsp;</b><?if(isset($metaData['city_name'])) :?><?= $metaData['city_name']?><?endif?></b>(<?if(isset($metaData['district_name'])) :?><?= $metaData['district_name']?><?endif?>)</div>
                  <!--<div class="catagory_result_add"><b><?=t(750)?></b> : +84 4 37661758</div>
                  <div class="catagory_result_add"><b>Hotline</b> : 0989 345 678</div>-->
                  <div class="catagory_result_add"> <?= substring_n_words(strip_tags($this->viewParams['aList'][$event['id']]['article_body']), 50);?> ... </div>
                  <div class="clear"></div>
            </div> 
            <?if(strpos($sess->userPermissions, "update event") || 
            ($sess->user == $event['poster_id'] && strpos($sess->userPermissions,"update own event"))
            ) :?>
				<div style="float:right;">
					<a href="<?=$this->hvnUrl(array('module' => 'event', 'action' => 'edit'))?>?id=<?=$event['id']?>"><?=t(38) ?></a>
					| <a href="<?=$this->hvnUrl(array('module' => 'article', 'action' => 'translate'))?>?id=<?=$this->viewParams['aList'][$event['id']]['article_id']?>&to=en"><?=t(90)?></a>
				</div>
				<div class="clear"></div>
			<?endif?>
            <?endforeach?>
            
          <div class="clear"></div>

<!-- pagination -->
<div>
<?
$pageCount = ceil($this->viewParams['paginator']->getTotalItemCount()/$this->viewParams['paginator']->getItemCountPerPage());
?>
<? if ($pageCount > 1) :?>
	<?= $this->paginationControl($this->viewParams['paginator'], 'Sliding', '/modules/common/views/scripts/commonTheme/commonLang/common/clu-pagination-control.phtml',
							    array('searchUrl' => $this->viewParams['searchUrl'])); ?>
<?endif ?>
</div>


<div class="clear"></div>
</div>        
	  
<?else:?>
<?=sprintf(t(144), t(201)) ?>
<?endif ?>    

</div>